﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Temp.aspx.cs" Inherits="Customer_Profile.eCard.Temp" %>

<%@ Register assembly="DevExpress.Web.v9.3, Version=9.3.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxUploadControl" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.v9.3, Version=9.3.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxRoundPanel" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v9.3, Version=9.3.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language="javascript">
        var fieldSeparator = "|";
        function FileUploadStart() {
            alert('1');
            document.getElementById("HiddenField1").value;
        }
        function FileUploaded(s, e) {
            if (e.isValid) {
                alert('2');
//                var linkFile = document.createElement("a");
//                var indexSeparator = e.callbackData.indexOf(fieldSeparator);
//                var fileName = e.callbackData.substring(0, indexSeparator);
//                var pictureUrl = e.callbackData.substring(indexSeparator + fieldSeparator.length);
//                var date = new Date();
//                var imgSrc = "eCard/tempUpload/" + pictureUrl + "?dx=" + date.getTime();
//                linkFile.innerHTML = fileName;
//                linkFile.setAttribute("href", imgSrc);
//                linkFile.setAttribute("target", "_blank");
//                var container = document.getElementById("uploadedListFiles");
//                container.appendChild(linkFile);
//                container.appendChild(document.createElement("br"));
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <dx:ASPxUploadControl ID="UploadControl" runat="server" ShowAddRemoveButtons="True" Width="300px"
             ShowUploadButton="True" AddUploadButtonsHorizontalPosition="Left" ShowProgressPanel="True"
             ClientInstanceName="UploadControl" OnFileUploadComplete="UploadControl_FileUploadComplete" FileInputCount="3">
             <ValidationSettings AllowedContentTypes="image/jpeg, image/gif, image/pjpeg" AllowedFileExtensions=".jpg,.jpeg,.jpe,.gif">
             </ValidationSettings>
             <%--<ClientSideEvents
                 fileuploadcomplete="function(s, e) { FileUploaded(s, e) }"
                 fileuploadstart="function(s, e) { FileUploadStart(); }"
             />--%>
         </dx:ASPxUploadControl>
         <br />
         abc
         <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="300px" 
            ClientInstanceName="RoundPanel" HeaderText="Uploaded files (jpeg, gif)" 
            Height="100%" BackColor="#DDECFE" 
            CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
            CssPostfix="Office2003Blue" EnableDefaultAppearance="False" 
            SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
             <ContentPaddings Padding="2px" PaddingBottom="10px" PaddingTop="10px" />
             <HeaderStyle BackColor="#7BA4E0">
             <Paddings Padding="0px" PaddingBottom="7px" PaddingLeft="2px" 
                 PaddingRight="2px" />
             <BorderBottom BorderColor="#002D96" BorderStyle="Solid" BorderWidth="1px" />
             </HeaderStyle>
             <HeaderLeftEdge>
                 <BackgroundImage HorizontalPosition="left" 
                     ImageUrl="~/App_Themes/Office2003Blue/Web/rpHeader.png" Repeat="RepeatX" 
                     VerticalPosition="top" />
             </HeaderLeftEdge>
             <HeaderContent>
                 <BackgroundImage HorizontalPosition="left" 
                     ImageUrl="~/App_Themes/Office2003Blue/Web/rpHeader.png" Repeat="RepeatX" 
                     VerticalPosition="top" />
             </HeaderContent>
             <HeaderRightEdge>
                 <BackgroundImage HorizontalPosition="left" 
                     ImageUrl="~/App_Themes/Office2003Blue/Web/rpHeader.png" Repeat="RepeatX" 
                     VerticalPosition="top" />
             </HeaderRightEdge>
             <NoHeaderTopEdge BackColor="#DDECFE">
             </NoHeaderTopEdge>
             <TopEdge>
                 <BackgroundImage HorizontalPosition="left" 
                     ImageUrl="~/App_Themes/Office2003Blue/Web/rpTopEdge.png" Repeat="RepeatX" 
                     VerticalPosition="top" />
             </TopEdge>
            <PanelCollection>
                <dx:PanelContent runat="server">
                     <div id="uploadedListFiles" style="height: 150px; font-family: Arial;"></div>
                </dx:PanelContent>
            </PanelCollection>
             <Border BorderColor="#002D96" BorderStyle="Solid" BorderWidth="1px" />
             <DisabledStyle ForeColor="Gray">
             </DisabledStyle>
        </dx:ASPxRoundPanel>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
        <asp:HiddenField ID="HiddenField1" runat="server" />
    </div>
    </form>
</body>
</html>
